
varying vec2 vUv;
varying vec3 vPositionWS;

void main() {
    vUv = uv;

    vec4 transformed = vec4(position, 1.);

#ifdef USE_INSTANCING
    transformed = instanceMatrix * transformed;
#endif

    vec4 positionWS = modelMatrix * transformed;
    vec4 mvPosition = viewMatrix * positionWS;

    gl_Position = projectionMatrix * mvPosition;
    vPositionWS = positionWS.xyz;
}
